package com.hnas.hnt.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.hnas.hnt.dao.MrchDAO;
import com.hnas.hnt.orm.EQPInfo;
import com.hnas.hnt.orm.Mrch;
import com.hnas.trade.service.dto.DTOResultTransApp;
import com.hnas.trade.service.dto.DTOSearchTrans;


@Component("mrchService")
@Transactional(isolation = Isolation.READ_COMMITTED, readOnly = false, propagation = Propagation.REQUIRED, value = "transactionManagerHnt")
public class MrchService implements IMrchService {
	/**
	 * 
	 */
	@Autowired
	private MrchDAO mrchDAO;
	@Autowired
	private IIndustryService industryService;
	
	
	public List<Mrch> getMrchs(){
		return this.mrchDAO.getMrchs();
	}
	public List<Mrch> getMrchsAll(){
		return this.mrchDAO.getMrchsAll();
	}
	public List<Mrch> getMrchsByIndustryId(String industryId){
		return this.mrchDAO.getMrchsByIndustryId(industryId);
	}
	public List<Mrch> getMrchsById(String mrchID){
		return this.mrchDAO.getMrchsById(mrchID);
	}
	
	public String getMrchNameById(String mrchID){
		Mrch vo= this.mrchDAO.find(mrchID);
		String mrchName="";
		if(null!=vo){
			mrchName=vo.getMRCH_NAME();
		}
		return mrchName;
	}
	@Override
	public List<EQPInfo> getEQPsByMrchId(String mrchId){
		return this.mrchDAO.getEQPsByMrchId(mrchId);
	}
	
	@Override
	public String checkData(String id,String param) {
		return this.mrchDAO.checkData(id,param);
	}
	@Override
	public List<DTOResultTransApp> searchTransAppNew(DTOSearchTrans dtoSearchTrans) {
		return mrchDAO.searchTransAppNew(dtoSearchTrans);
	}
	
	@Override
	public List<DTOResultTransApp> searchTransAppNew3(DTOSearchTrans dtoSearchTrans) {
		return mrchDAO.searchTransAppNew3(dtoSearchTrans);
	}
	@Override
	public List<DTOResultTransApp> findOldHBTranRecord() {
		return mrchDAO.findOldHBTranRecord();
	}
	
}
